#include "QD3DShaderDesc.h"

QD3DShaderDesc::QD3DShaderDesc (UINT flags,
		const QMap< std::string, std::string > &defines,
		ID3D10Include *pIncludeFileHandler) : _flags (flags),
		_defines (defines), _pIncludeFileHandler (pIncludeFileHandler)
{
#if defined(DEBUG) || defined(_DEBUG)
	_flags |= D3DCOMPILE_DEBUG;
#endif
}

QD3DShaderDesc::~QD3DShaderDesc ()
{

}

void QD3DShaderDesc::setDefine (const std::string &name, const std::string &value)
{
	_defines[name] = value;
}

void QD3DShaderDesc::removeDefine (const std::string &name)
{
	_defines.remove (name);
}

const QMap< std::string, std::string > & QD3DShaderDesc::getDefines () const
{
	return _defines;
}

void QD3DShaderDesc::setPIncludeFileHandler (ID3D10Include *pIncludeFileHandler)
{
	_pIncludeFileHandler = pIncludeFileHandler;
}

ID3D10Include * QD3DShaderDesc::getPIncludeFileHandler ()
{
	return _pIncludeFileHandler;
}

const ID3D10Include * QD3DShaderDesc::getPIncludeFileHandler () const
{
	return _pIncludeFileHandler;
}

void QD3DShaderDesc::setFlags (UINT flags)
{
	_flags = flags;
}

void QD3DShaderDesc::addFlag (UINT flag)
{
	_flags |= flag;
}

void QD3DShaderDesc::clearFlag (UINT flag)
{
	_flags &= ~flag;
}

UINT QD3DShaderDesc::getFlags () const
{
	return _flags;
}